import React, { Component } from 'react'
import Home from '../pages/Home';
import About from '../pages/About';
import {Route, NavLink, Redirect} from 'react-router-dom';
import Header from '../Header'
import MyNavLink from '../MyNavLink';
export default class App extends Component {
    render() {
        return (
            <div>
                <div className="row">
                    <div className="col-xs-offset-2 col-xs-8">
                        <div className="page-header">
                            <h2>React Router Demo</h2>
                        </div>
                    </div>
                </div>
                <div className="row">
                    <div className="col-xs-2 col-xs-offset-2">
                        <div className="list-group">
                            <MyNavLink to="/about">关于我们</MyNavLink>
                            <MyNavLink to="/home">首页</MyNavLink>
                        </div>
                    </div>
                    <div className="col-xs-6">
                        <Header name="张三" age={20} />

                        <Route path="/home"  component={Home}  name="张三"  age={24} />
                        <Route path="/about"  component={About}  />
                        <Redirect to="/home" />
                    </div>
                </div>
            </div>
        )
    }
}
